Skip to content

Synthetic Source internal, dependency operation name, enhance event message#3087

Merged
rajkumar-rangaraj merged 7 commits intomainfrom
rajrang/mybranch
Jan 27, 2026
Merged

Synthetic Source internal, dependency operation name, enhance event message#3087
rajkumar-rangaraj merged 7 commits intomainfrom
rajrang/mybranch

Conversation

@rajkumar-rangaraj
Copy link
Member

Fix Issue # .

Changes

(Please provide a brief description of the changes here.)

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Copilot AI review requested due to automatic review settings January 26, 2026 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes three main improvements to the Application Insights SDK: (1) changes the SyntheticSource property from public to internal, (2) adds operation name tracking to dependency telemetry for better correlation, and (3) refactors EventSource logging methods with more specific names and clearer error messages.

Changes:

  • Refactored EventSource methods from generic LogError to specific methods: FailedToAddTelemetry, InvalidTracesPerSecondConfigured, InvalidSamplingRatioConfigured, and TelemetryConfigurationFailure with improved error messages
  • Added operation name tag to dependency telemetry tracking to maintain parity with request telemetry
  • Changed SyntheticSource property visibility from public to internal in OperationContext

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/OperationContext.cs Changed SyntheticSource property from public to internal
BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs Added operation name tag to dependency telemetry activities
NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensibility/Implementation/Tracing/AspNetCoreEventSource.cs Replaced generic LogError with specific event methods and improved messages
NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/ApplicationInsightsExtensions.cs Updated to use new specific EventSource methods
NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Implementation/Tracing/WorkerServiceEventSource.cs Replaced generic LogError with specific event methods and improved messages
NETCORE/src/Microsoft.ApplicationInsights.WorkerService/ApplicationInsightsExtensions.cs Updated to use new specific EventSource methods
NETCORE/src/Shared/Extensions/ApplicationInsightsExtensions.cs Updated to use new TelemetryConfigurationFailure method
Comments suppressed due to low confidence (2)

NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Implementation/Tracing/WorkerServiceEventSource.cs:87

  • The XML documentation comment incorrectly refers to "AspNetEventSource" but this is in the WorkerServiceEventSource class. It should be "Keywords for the WorkerServiceEventSource."
        /// <summary>
        /// Keywords for the AspNetEventSource.
        /// </summary>

BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs:635

  • The documentation for TrackDependency needs to be updated to include the microsoft.operation_name override attribute that is being added in this PR. The TrackRequest method documentation already includes this attribute (line 769), and TrackDependency should have similar documentation. Add a new bullet point: "microsoft.operation_name → RemoteDependencyData.Context.Operation.Name" to the Override Attributes list around line 577.

                    if (!string.IsNullOrEmpty(telemetry.Name))
                    {
                        dependencyTelemetryActivity.SetTag(SemanticConventions.AttributeMicrosoftDependencyName, telemetry.Name);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rajkumar-rangaraj rajkumar-rangaraj enabled auto-merge (squash) January 27, 2026 19:56
@rajkumar-rangaraj rajkumar-rangaraj merged commit 81f97ca into main Jan 27, 2026
22 checks passed
@rajkumar-rangaraj rajkumar-rangaraj deleted the rajrang/mybranch branch January 27, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants